﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace WCell.RealmServer.Spells.Auras
{
	[StructLayout(LayoutKind.Explicit, Size = 4)]
	public struct AuraUID
	{
		[FieldOffset(0)]
		public uint UID;

		[FieldOffset(3)]
		public AuraUniqueFlags Flags;

		public override bool Equals(object obj)
		{
			return obj is AuraIndex && (((AuraUID)obj).UID == UID && ((AuraUID)obj).Flags == Flags);
		}

		public override int GetHashCode()
		{
			return (int)Flags | (UID.GetHashCode() >> 8);
		}
	}

	[Flags]
	public enum AuraUniqueFlags : byte
	{
		Unique = 0x01,
		UniquePerCaster = 0x02
	}
}
